home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / VISUAL_B / H441.ZIP / VXBTEST.ZIP / VXFORM2.FRM (.txt) < prev    next >
Visual Basic Form  |  1993-05-06  |  12KB  |  268 lines

  1. VXFORM2
  2. Aircraft Types
  3. Form3%
  4. TypeStatus
  5. TypeExit
  6. E&xit
  7. TypeBrowse
  8. &Browse
  9. TypePrev
  10.     &Previous
  11. TypeNext
  12. &Next
  13. TypeDelete
  14. &Delete
  15. TypeAdd
  16. TypeCancel
  17. &Cancel
  18. TypeSave
  19. &Save
  20. TypeDesc
  21. TypeCode
  22. Label3
  23. Status
  24. MS Serif
  25. Label2
  26. Description
  27. MS Serif
  28. Label1
  29.     Type Code
  30. MS Serif
  31.     Form_Load
  32. vxSelectDbfa
  33. AirtypesDbf
  34. Form2Active
  35. TypeReturn
  36. BROWSE_ADD
  37. TypeDataClear
  38. TypeStatusm
  39. TypeSave
  40. EnabledJ
  41. TypeCancel:
  42. TypeAddy
  43. FALSEU
  44. TypeDelete
  45. BROWSE_EDIT
  46. TypeDataLoad
  47. vxRecNo
  48. TypeCode
  49. TypeDesc
  50. vxUnlockd
  51. CursorWait
  52. vxField
  53. CursorArrow
  54. TypeCode_KeyPress
  55. KeyAsciis
  56. TypeSave_Click
  57. SeekKey
  58. EmptyString
  59. vxSeek
  60. vxAppendBlank
  61. vxReplString
  62. vxWrite:
  63. TypeAdd_Click
  64. TypeBrowse_Click
  65. VXFORM2
  66. Visible
  67. BROWSE_USER3
  68. BrowseTypes
  69. TypeCancel_Click
  70. TypeDelete_Click&
  71. vxLockRecord
  72. vxDeleteRec
  73. TypeExit_Click?
  74. TypeNext_ClickZ
  75. vxSkip
  76. TypeNext
  77. TypePrev
  78. TypeBrowseQ
  79. vxEof
  80.     vxDeleted
  81. vxBottomx
  82. TypePrev_Click
  83. vxBofc
  84. vxTop
  85. TypeCode_GotFocus
  86. vxCtlLength4
  87. TypeDesc_GotFocus
  88. Form_Unload
  89. Cancel
  90. vxClose
  91. vxWindowDereg
  92. VXFORM1
  93.     OpenTypesW
  94. OpenCust
  95.     PackFiles
  96. TestCreate$
  97. TestCopy
  98. TestDataCopy
  99. TypeDesc_KeyPresst
  100. Form_Paintf
  101. vxFormFrame
  102. vxCtlStyle
  103.     VX_RECESS
  104. VX_RAISE
  105. BROWSE_DELETE
  106. vxCtlFormat
  107. VX_UPPER
  108. vxUseDbf
  109. vxPictureImport
  110. vxPictureRead
  111. PicBox
  112. Picture
  113.     ClipBoard
  114. Form_Load
  115.  On form load analyze results of browse return
  116.  ALWAYS select the database as the first statement
  117.  in the FORM_LOAD procedure. This registers thee
  118.  select area with the vxBase System Task manager.
  119.  You MUST also select the database as the firstr
  120.  statement in the FORM_PAINT procedure. This
  121.  registers the select area with the vxBase Taskr
  122.  Window manager. If you do these two things, vxBase
  123.  will ensure smooth multiwindow operation in the
  124.  task, and also smooth multitasking operation if you
  125.  wish to run more than one Visual Basic vxBase program
  126.  at the same time (or multiple instances of the same
  127.  Visual Basic vxBase program.e
  128. Record addition request
  129.  if user pressed ENTER then file is positioned
  130.  at current record and the record number isn
  131.  returned in TypeReturn. In this case we assume
  132.  he wants to edit that record.
  133.  call general proc to load controls-
  134. Edit record 
  135. Form_Paint
  136.  ALWAYS select the database as the first statement
  137.  in the FORM_LOAD procedure. This registers thee
  138.  select area with the vxBase System Task manager.
  139.  You MUST also select the database as the firstr
  140.  statement in the FORM_PAINT procedure. This
  141.  registers the select area with the vxBase Taskr
  142.  Window manager. If you do these two things, vxBase
  143.  will ensure smooth multiwindow operation in the
  144.  task, and also smooth multitasking operation if you
  145.  wish to run more than one Visual Basic vxBase program
  146.  at the same time (or multiple instances of the same
  147.  Visual Basic vxBase program.e
  148.  paint three dimensional controls-
  149.  if delete request from browse, do it now-
  150.  because we must let enhanced controls
  151.  paint before asking for delete confirmation
  152. Form_Unload
  153.  close types file and reset table
  154.  and reenable menu items if we're
  155.  NOT being unloaded by the Browse button
  156.  IT IS IMPORTANT THAT YOU DEREGISTER
  157.  THE WINDOW THAT THE FILE SELECT
  158.  AREA WAS ATTACHED TO IN THE FORM_UNLOAD PROC.
  159.  IF YOU DON'T, YOU ARE LIABLE TO RUN OUT OFO
  160.  TASK-WINDOW ENTRIES (96 in all are allowed)
  161.  If BrowseTypes is invoked by clicking the Browse-
  162.  button on the edit form, we don't want to close
  163.  the files. If we get here for any other reasone
  164.  (like picking the exit button on the form oro
  165.  using the System menu to close the window) then
  166.  we close the files, release the table memory, and
  167.  reshow the menu form so the user can pick something
  168.  else.
  169. TypeAdd_Click
  170.  clear form for addition of new record
  171. Record Addition Request
  172.  ensure data entry enabled
  173.  reset the buttons
  174. TypeBrowse_Click
  175.  current form is unloaded because if needed again
  176.  the form_load proc must be invoked to reset the
  177.  control datad
  178.  so we don't close files
  179.  when we unload the form
  180. TypeCancel_Click
  181.  Clear form data and reset button status
  182. Operation cancelled
  183.  we must disable data entry because the user
  184.  could enter a new record in the blank boxes
  185.  and then press the Add button. The TypeAdd_Click
  186.  routine clears the form boxes again prior tol
  187.  accepting input so the user's work would be lost
  188.  and he would be mad.h
  189. TypeCode_GotFocus
  190.  set up text length limit
  191.    Call vxCtlLength("category"))
  192. TypeCode_KeyPress
  193.  Convert type code to uppercase as it is being entered
  194.  also convert enter key to tab
  195.    C$ = Chr$(KeyAscii)
  196.    C$ = UCase$(C$)
  197.    KeyAscii = Asc(C$))
  198.    If KeyAscii = 13 Then
  199.  KeyAscii = 0=
  200.  SendKeys "{Tab}" 
  201.    End Iff
  202. TypeDataClear
  203.  Clear Form in preparation for add or after successful delete
  204.  ensure database unlocked-
  205. TypeDataLoad
  206.  Load data from current record
  207.  ensure data entry enabled
  208. category
  209. catname
  210.  unlock for multiusers
  211.  In a multiuser or multitasking environment, the file-
  212.  should be unlocked after you have extracted the data-
  213.  you are interested in. See the "MultiTasking andd
  214.  MultiUser Considerations" section in the manual for
  215.  a full discussion.a
  216. TypeDelete_Click
  217.  get user confirmation of delete
  218. Confirm Delete
  219.  Deleted
  220. Delete failed
  221. Delete cancelled
  222. TypeDesc_GotFocus
  223.  set up text length limit
  224. catname
  225. TypeDesc_KeyPress
  226.  convert ENTER to tab-
  227. {Tab}
  228. TypeExit_Click
  229.  unloading the form performs cleanup for us
  230. TypeNext_Click
  231.  skip forward one record
  232.  if skip error, only allow exit-
  233. Error on Skip Next. Try Reindex.
  234.  test for end of file 
  235. End of File!
  236. Skipped to record 
  237. TypePrev_Click
  238.  skip back one record
  239.  if skip error, only allow exit
  240. Error on Skip Previous. Try Reindex.
  241.  test for beginning of filer
  242. Beginning of File!
  243. Skipped to record 
  244. TypeSave_Click
  245.  Validate data when save button is pressed
  246.  verify something in the field
  247. Field cannot be empty
  248.  note that if this was a real application we wouldn't-
  249.  allow a change to the type code if the record was being
  250.  edited unless we were prepared to cross reference all
  251.  of the other files affected by a change. We alsoe
  252.  wouldn't allow the onscreen edit in the browse. This is
  253.  just a sample application.n
  254.  verify unique key if adding
  255. Duplicate Key on Add
  256.  Data passed. Put it away
  257.  notice the brackets around the control property
  258.  below which gets at the data contained thereiny
  259. category
  260. catname
  261.  Update status box
  262. Record 
  263.  appended
  264. Record 
  265.  saved
  266.  Update Button Status
  267.  ensure database unlockedd
  268.